import React,{Component} from 'react'
export default class Comment extends Component{
    handleDeleteComment(){
        this.props.onDelete(this.props.index)
    }
    render(){
        return(
            <div>
                <div className="user">
                    @{this.props.comment.username}
                </div>
                <div className="content">
                    {this.props.comment.content}
                    <span 
                        className='delete'
                        onClick={this.handleDeleteComment.bind(this)}>delete</span>
                </div>
            </div>
        )
    }
}